#include<bits/stdc++.h>
using namespace std;
long long n;
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	freopen("road.in","r",stdin);
	freopen("road.out","w",stdout);
	cin>>n;
	if(n<=120){
		//10
		int x=n/10; 
		cout<<"4 "<<n%10+12+x<<"\n";
		for(int i=0;i<x;i++){
			cout<<"1 2 "<<10*i<<"\n";
		}
		cout<<"1 3 "<<x*10<<"\n";
		for(int i=0;i<=9;i++){
			cout<<"2 114 "<<i<<"\n";
		}
		for(int i=0;i<=n%10;i++){
			cout<<"3 114 "<<i<<"\n";
		}
		return 0;
	}
	int s=(int)(log2(n)+0.5);
	cout<<s+2<<" "<<(s+1)*2<<"\n";
	cout<<"1 114 "<<n<<'\n';
	for(int i=0;i<s;i++){
		cout<<i+1<<" "<<i+2<<" "<<0<<"\n";
		cout<<i+1<<" "<<i+2<<" "<<(1<<i)<<"\n";
	}
	cout<<s+1<<" 114 0\n";
	return 0;
}

